<?php
include '../newlib.php';
include '../lib/AppScope.pre.php';

include 'header.php';
$theUser = $app->theUser;
$program = $_REQUEST["program"];
$position = intval($_REQUEST["position"]);
echo <<<EOD
<h1>Pagina invoegen</h1>
<h2>Selekteer pagina om in  te voegen:</h2>
<form name="frmInvoegen" method="get" action="insert2.php">
<input type="hidden" value="$program" name="program"/>
<input type="hidden" value="$position" name="position"/>
<select name="invoegen">
EOD;
foreach ($tmpConnection->query('select id,titel from content order by lcase(titel)') as $row) {
	$rowId = $row['id'];
	$rowTitel = $row['titel'];
	echo "<option value=\"$rowId\">$rowTitel</option>";
}
echo <<<EOD
</select>
<input type="submit" value="OK">
</form>
EOD;

include 'footer.php';
?>